<template>
  <div>
    <a-modal
      ok-text="确认"
      cancel-text="取消"
      :maskClosable="false"
      :title="'添加生产计划'"
      :width="modalWidth"
      @cancel="handleClose"
      @ok="handleOk"
      :destroyOnClose="true"
      :visible="visible"
      footer=""
    >
      <template>
        <div class="modalBut">
          <a-button @click="handleClose">
            取消
          </a-button>
          <a-button @click="handleOk" type="primary">确认</a-button>
        </div>
      </template>
      <a-input placeholder="添加生产计划" v-model="inputData" />
    </a-modal>
  </div>
</template>
<script>
export default {
  data() {
    return {
      visible: false, // 状态
      modalWidth: 452, // 抽屉宽度
      inputData: "",
    };
  },
  methods: {
    handleClose() {
      this.visible = false;
    },
    handleOk() {
      if (this.inputData.length < 1) {
        this.$message.error("请输入生产计划");
      } else {
        this.$emit("ok", this.inputData);
        this.visible = false;
      }
    },
    modalShow() {
      this.visible = true;
    },
  },
};
</script>
<style lang="less" scoped></style>
